package com.itlong.cloud.POJO.DTO.app;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;

/**
 *  云电梯预约呼梯控制指令
 */
@Getter
@Setter
public class AppCloudElevatorOrderDto {
    private String deviceUnique;


    private String sourceFrom;//命令发起方标识
    private JSONObject out; //外呼指令
    private String outCmdVer; //外呼指令版本
    private List<outData> outDataList = new ArrayList<>(); //外呼指令数据
    @Getter
    @Setter
    public static class outData{
        private String upDown;
        private String startingFloor;
        private String gotoFloor;
    }


    private JSONObject in; //内召指令
    private String inCmdVer;  //内召指令版本
    private List<inData> inDataList = new ArrayList<>(); //内召指令数据
    @Getter
    @Setter
    public static class inData{
        private String module;
        private String floor;
        private String time;
        private String negativeFloor;
    }


    public AppCloudElevatorOrderDto(String deviceUnique,String sourceFrom,JSONObject out,String outCmdVer,List<outData> outDataList,JSONObject in,String inCmdVer,List<inData> inDataList){
        this.deviceUnique = deviceUnique;
        this.sourceFrom = sourceFrom;
        if (out != null){
            out.put("cmdVer",outCmdVer);
            out.put("data",outDataList);
            this.out = out;
        }
        if (in != null){
            in.put("cmdVer",inCmdVer);
            in.put("data", inDataList);
            this.in = in;
        }
    }



}
